from rest_framework import serializers
from . import models


class BannerModelSerializer(serializers.ModelSerializer):
    """轮播图的序列化器"""

    class Meta:
        model = models.Banner
        fields = ['image', 'link']


from .models import Nav


class NavModelSerializer(serializers.ModelSerializer):
    """导航菜单的序列化器"""

    class Meta:
        model = Nav
        fields = ["name", "link", "position", "is_http"]
